package com.test.semaphore.exchanger;

import java.util.concurrent.Exchanger;

/**
 * @author:wesley
 */
public class ExchangeMain {

    public static void main(String[] args){
        Exchanger<String> exchanger = new Exchanger<>();

        ThreadA threadA = new ThreadA(exchanger);
        ThreadB threadB = new ThreadB(exchanger);
        ThreadC threadC = new ThreadC(exchanger);
        ThreadD threadD = new ThreadD(exchanger);

        threadA.start();
        threadB.start();
        threadC.start();
        threadD.start();

    }
}
